﻿using AnesSystem.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnesSystem.ViewModels
{
    public class FirstLevelMenuListCtrlViewModel:BaseViewModel<FirstLevelMenuListCtrlViewModel>
    {
        #region Variables

        private List<MenuListModel> menuBtns;

        #endregion

        #region Constructor

        public FirstLevelMenuListCtrlViewModel()
        {
            Initial();
        }

        #endregion

        #region Properties

        public List<MenuListModel> MenuBtns
        {
            get
            {
                return menuBtns;
            }

            set
            {
                menuBtns = value;
            }
        }

        public MenuListModel SelectedMenu { get; set; }

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        private void Initial()
        {
            menuBtns = new List<MenuListModel>();
            InitialMenus();
        }

        private void InitialMenus()
        {
            menuBtns = DataManager.Instance.MenuList.Where(O => O.Parent == 0).OrderBy(O => O.Order).ToList();
        }

        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        #endregion
    }
}
